/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: TC001_CL.java 656 2007-06-27 09:32:35Z jack.rybicki $
 */
package gammu.java.example;

import gammu.java.GammuStateMachine;
import gammu.java.OutgoingSMS;
import gammu.java.machines.GammuStateMachineCL;

import java.util.Map;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * DOCUMENT ME!
 * 
 */
public class TC001_CL {

	private GammuStateMachine sm;

	/**
	 * DOCUMENT ME!
	 * 
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		sm = new GammuStateMachineCL();
		sm.init();
	}

	/**
	 * DOCUMENT ME!
	 * 
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		sm.terminate();
	}

	@Test
	public void testPhoneProperties() {
		Map<String, String> result = sm.getBatteryInfo();
		result.putAll(sm.getNetworkInfo());
		result.putAll(sm.getPhoneId());
		result.putAll(sm.getSMSC(1));
		for (String key: result.keySet()) {
			System.out.println(key + " = " + result.get(key));
		}
	}
	
	@Test
	public void testSendSMS() {
		OutgoingSMS sms = new OutgoingSMS("550", "505034987");
		sm.sendSMS(sms);
		System.out.println("SMS sent");
	}
	
	@Test
	public void testIncomingCall() {
		sm.setIncomingCall(true);		
	}
}
